<?php defined('SYSPATH') OR die('No direct access allowed.');
	class Auth_Model extends Model {
		public function getPassword($username) {
			$result = $this->db->query("SELECT passwd FROM forum_members WHERE member_name=? LIMIT 1", $username);
			
			return $result[0]->passwd;
		}
		
		public function getIdPassword($username) {
			$result = $this->db->query("SELECT id_member, passwd FROM forum_members WHERE member_name=? LIMIT 1", $username);
			
			return $result[0];
		}
		
		public function getSession($token) {
			$result = $this->db->query("SELECT user_id, lastactive, timeout FROM forum_newsessions WHERE token=?", $token);
			
			return $result[0];
		}
		
		public function setSession($token, $userid, $time, $timeout) {
			$this->db->query("INSERT INTO forum_newsessions (token, user_id, lastactive, timeout) VALUES (?, ?, ?, ?)", $token, $userid, $time, $timeout);
		}
		
		public function deleteSession($token) {
			$this->db->query("DELETE FROM forum_newsessions WHERE token=?", $token);
		}
	}
?>
